package com.zby.model.pojo;

import com.zby.model.enums.RoleEnum;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.dromara.autotable.annotation.AutoColumn;
import org.dromara.autotable.annotation.AutoTable;
import org.dromara.autotable.annotation.Index;
import org.dromara.autotable.annotation.enums.IndexTypeEnum;

/**
 * @author wuyanzhu
 */
@EqualsAndHashCode(callSuper = true)
@Data
@AutoTable(comment = "用户")
@Schema(description = "用户")
public class User extends BasePojo {
    @Schema(description = "用户名")
    @Index(type = IndexTypeEnum.UNIQUE)
    @AutoColumn(length = 50, notNull = true, comment = "用户名")
    private String username;

    @Schema(description = "密码")
    @AutoColumn(length = 60, notNull = true, comment = "密码")
    private String password;

    @Schema(description = "作者昵称")
    @AutoColumn(length = 255, comment = "作者昵称")
    private String authorName;

    @Schema(description = "邮箱")
    @AutoColumn(length = 100, comment = "邮箱")
    private String email;

    @Schema(description = "角色")
    @AutoColumn(notNull = true, comment = "角色")
    private RoleEnum role;

    @Schema(description = "头像")
    @AutoColumn(length = 255, comment = "头像")
    private String avatar;
}
